<%--
  Created by IntelliJ IDEA.
  User: Acer
  Date: 2020/9/1
  Time: 19:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>

<rapid:override name="head">
    <title>修改密码</title>
</rapid:override>

<rapid:override name="content">
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()  + path + "/";
    %>
    <div style="width: 500px;margin: 80px auto" >
        <form class="layui-form" action="<%=basePath%>teacher/changeTeaPass" lay-filter="example" method="post" id="changeForm">
            <input type="hidden" name="id" value="${sessionScope.teaid}">
            <div class="layui-form-item">
                <label class="layui-form-label">原密码:</label>
                <div class="layui-input-block">
                    <input  type="password" name="prePass" lay-verify="title" autocomplete="off" placeholder="请输入原密码" class="layui-input">
                    &nbsp;&nbsp;
                    <p style="color: red">${msg}</p>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新密码:</label>
                <div class="layui-input-block">
                    <input  type="password" id="firstPass"  name="firstPass" placeholder="请输入新密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码:</label>
                <div class="layui-input-block">
                    <input  type="password" id="secondPass" placeholder="请确认新密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <button type="button" class="layui-btn layui-btn-danger layui-btn-lg" style="margin:0 200px;">
                确认修改
            </button>
        </form>

    </div>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/layer/layer.js"></script>
    <script>
        let prePass = $('#prePass').val();

        $("button").click(function () {
            if($('#firstPass').val() === $('#secondPass').val()) {
                $('#changeForm').submit();
            } else {
                alert("两次密码输入不一致！！！")
            }
        })

    </script>
</rapid:override>
<%@include file="base.jsp"%>